import request from '@/utils/request'
import {DeleteRequest, ListRequest, Menu} from "@/interface/menu";

//菜单列表
export const MenuListR = () => {
  return request({
    method: 'GET',
    url: '/menu',
  })
}

//添加菜单
export const MenuAddR = (req: Menu) => {
  return request({
    method: 'POST',
    url: '/menu',
    data: JSON.stringify(req),
  })
}

//修改菜单
export const MenuUpdateR = (req: Menu) => {
  return request({
    method: 'PUT',
    url: '/menu',
    data: JSON.stringify(req),
  })
}


//删除菜单
export const MenuRemoveR = (req:DeleteRequest) => {
  return request({
    method: 'DELETE',
    url: `/menu`,
    params: req
  })
}

